<script src="<?php echo Yii::app()->request->baseUrl; ?>/scripts/deposit.js" type="text/javascript" charset="utf-8"></script>
<h1>
	<?php 
		echo Yii::t('main', 'add_coin').' '.Yii::t('main', 'via').' ';
		if($type == 'wmz')
			echo Yii::t('main', 'add_coin.wmz');
		if($type == 'pm')
			echo Yii::t('main', 'add_coin.pm');
		if($type == 'bk')
			echo Yii::t('main', 'add_coin.bk');
		if($type == 'nl')
			echo Yii::t('main', 'add_coin.nl');
		if($type == 'sms')
			echo Yii::t('main', 'add_coin.sms');
		if($type == 'mcard')
			echo Yii::t('main', 'add_coin.mcard');
		if($type == 'gcard')
			echo Yii::t('main', 'add_coin.gcard');
	?>
</h1>
<hr>
<div class="form">
<fieldset style="text-align:left">
	<?php $form=$this->beginWidget('CActiveForm', array(
		'id'=>'deposit-form',
		'enableAjaxValidation'=> true,
		'enableClientValidation'=> false,
		'htmlOptions' => array(
			'class' => 'form-horizontal',
	        'enctype' => 'multipart/form-data'
		)
	)); ?>
	<?php 
		if(in_array($type, array('wmz', 'pm', 'bk', 'nl'))){
			if($type == 'wmz') $fee = 0.8;
			if($type == 'pm') $fee = 0.5;
			if($type == 'bk') $fee = 1;
			if($type == 'nl') $fee = 1;
	?>
        <div class="control-group">
            <label class="control-label"><?php echo Yii::t('main', 'amount_transfer');?></label>
            <div class="controls">
            	<?php 
            		$keypress = 'return isNumberKey(event);';
            		if($type == 'bk' || $type == 'nl') $keypress = 'return onlyNumber(event);';
            	?>
                <?php echo $form->textField($model,'amount_transfer', array('class' => 'span6 deposit-error', 'onkeypress'=>$keypress, 'onblur'=>'amountTransfer(value, "'.$type.'");'));?>
                <?php echo $form->error($model,'amount_transfer',array('inputContainer' => 'span','errorCssClass' => 'errorMsg')) ?>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"><?php echo Yii::t('main', 'you_need_have');?></label>
            <div class="controls">
                <?php echo $form->textField($model,'you_need_have', array('class' => 'span6 deposit-error', 'readonly'=>true, 'id'=>'you_need_have'));?>
                <br />
                <?php echo Yii::t('main', 'fee').' <b style="color:red;">'.$fee.'%</b>';?>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"><?php echo Yii::t('main', 'coin').' '.Yii::t('main', 'you_will_receive');?></label>
            <div class="controls">
                <?php echo $form->textField($model,'amount_receive', array('class' => 'span6 deposit-error', 'readonly'=>true, 'id'=>'amount_receive'));?>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"><?php echo Yii::t('main', 'code_deposit_of_you');?></label>
            <div class="controls">
                <?php echo $form->textField($model,'code_deposit', array('class' => 'span6', 'onkeypress'=>'return onlyNumber(event);', 'maxlength'=>8));?>
                <?php echo $form->error($model,'code_deposit',array('inputContainer' => 'span','errorCssClass' => 'errorMsg')) ?>
                <br />
                <?php echo Yii::t('main', 'note_deposit_coin');?>
            </div>
        </div>
        <?php if(CCaptcha::checkRequirements()): ?>
		<div class="control-group">
			<?php echo $form->labelEx($model,'verifyCode',array('class' => 'control-label')); ?>
			<div class="controls captcha">
			<?php $this->widget('CCaptcha'); ?><br>
			<?php echo $form->textField($model,'verifyCode'); ?>
			<?php echo $form->error($model,'verifyCode'); ?>
			</div>
		</div>
		<?php endif; ?>
        <div class="form-actions">
            <button type="submit" class="btn btn-primary"><?php echo Yii::t("main", "payment");?></button>
            <button type="reset" class="btn" ><?php echo Yii::t("lbl", "0002");?></button>
        </div>
     <?php }else {
     	echo '<center><label>--Under Construction--</label></center>';
     }
     ?>
<?php $this->endWidget(); ?>
</fieldset>
</div><!-- form -->